package info.rongtong.domain;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Article entity. @author MyEclipse Persistence Tools
 */

public class Article implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -3616189958494456303L;
	private Integer aid;
	private String atitle;
	private String acontent;
	private Date atime;
	private String alabel;
	private Integer atop;
	private Integer arecommend;
	private String author;
	private Integer areadNum;
	private Integer apeak; //这列将会被去掉
	private Category category;

	// Constructors

	/** default constructor */
	public Article() {
	}


	public Integer getAid() {
		return this.aid;
	}

	public void setAid(Integer aid) {
		this.aid = aid;
	}

	public String getAtitle() {
		return this.atitle;
	}

	public void setAtitle(String atitle) {
		this.atitle = atitle;
	}

	public String getAcontent() {
		return this.acontent;
	}

	public void setAcontent(String acontent) {
		this.acontent = acontent;
	}

	public Date getAtime() {
		return this.atime;
	}

	public void setAtime(Date atime) {
		this.atime = atime;
	}

	public String getAlabel() {
		return this.alabel;
	}

	public void setAlabel(String alabel) {
		this.alabel = alabel;
	}

	public Integer getAtop() {
		return this.atop;
	}

	public void setAtop(Integer atop) {
		this.atop = atop;
	}

	public Integer getArecommend() {
		if(arecommend==null)
			arecommend=0;
		return this.arecommend;
	}

	public void setArecommend(Integer arecommend) {
		this.arecommend = arecommend;
	}

	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Integer getAreadNum() {
		if(areadNum!=null)
			return this.areadNum;
		else
			return 0;
	}

	public void setAreadNum(Integer areadNum) {
		this.areadNum = areadNum;
	}

	public Integer getApeak() {
		return this.apeak;
	}

	public void setApeak(Integer apeak) {
		this.apeak = apeak;
	}


	public Category getCategory() {
		return category;
	}


	public void setCategory(Category category) {
		this.category = category;
	}
	
	public String getFormatTime(){
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
		return format.format(this.getAtime());
	}

	
}